function tax(a){
    if(a<5000){
        return '不用交税';
    }
    if(a>8000){
    return (a-8000)*0.1;
    }else{
        return (a-3000)*0.05;
    }
}
console.log(tax(9000));